/**
 * RegistrationServer.java
 *
 * @author Beatrice Bacelli
 * @author Luca Bedogni
 * @author Silvia Righini
 */
package unibo.lsb.server;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;

import unibo.lsb.exception.TokioException;
import unibo.lsb.logic.PlayerId;

public interface RegistrationServer extends Remote {

	/**
	 * Returns a list of {@link Game}
	 */
	public List<Game> getGameList() throws TokioException, RemoteException;

	/**
	 * Creates a {@link Game} object.
	 */
	public boolean createGame(String gameName, int players)
			throws TokioException, RemoteException;

	/**
	 * Adds a player to a {@link Game}, and returns its newly created
	 * {@link PlayerId}
	 * 
	 * @param gameName
	 *            the name of the game the player wants to join
	 * @param playerName
	 *            the name of the player
	 * @param password
	 * @param port
	 * @return a new PlayerId with the player username and other infos
	 * @throws TokioException
	 * @throws RemoteException
	 */
	public PlayerId joinGame(String gameName, String playerName,
			String password, int port) throws TokioException, RemoteException;

	/**
	 * Confirms the player is ready to start the game.
	 * 
	 * @param gameName
	 *            game for which the player is ready
	 * @return
	 * @throws TokioException
	 * @throws RemoteException
	 */
	public boolean confirm(String gameName) throws TokioException,
			RemoteException;

}
